<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
     <form name="frm" method="post">
          <table width="298" border="0" align="center">
             <tr>
                <td colspan="2" align="center">
                                                   简易计算器
                </td>
             </tr>
             <tr>
                <td width="76" align="center">第一个数</td>
                <td width="206"><input type="text" name="num1" value="${num1 }"></td>
             </tr>
             <tr>
                <td width="76" align="center">第二个数</td>
                <td width="206"><input type="text" name="num2" value="${num2 }"></td>
             </tr> 
             <tr>
                <td colspan="2" align="center">
                    <input type="submit" value="+" onclick="submitForm('jia')">
                    <input type="submit" value="-" onclick="submitForm('jian')">
                    <input type="submit" value="*" onclick="submitForm('cheng')">
                    <input type="submit" value="/" onclick="submitForm('chu')">
                </td>
             </tr>
             <tr>
                <td align="center">结果</td>
                <td><input type="text" name="result" readonly value="${result }"></td>
             </tr>   
          </table>
     </form>
</body>
      <script>
             function submitForm(op){
            	 frm.action="cal_"+op+".action";
            	 frm.submit();
             }
      </script>
</html>